import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("idx_goods_id", ["goodsId"], {})
@Entity("rrz_goods_skus", { schema: "rrzcms" })
export class RrzGoodsSkus {
  @PrimaryGeneratedColumn({
    type: "bigint",
    name: "sku_id",
    comment: "产品规格id",
    unsigned: true,
  })
  skuId: string;

  @Column("bigint", {
    name: "goods_id",
    comment: "产品id",
    unsigned: true,
    default: () => "'0'",
  })
  goodsId: string;

  @Column("decimal", {
    name: "price",
    nullable: true,
    comment: "产品价格",
    unsigned: true,
    precision: 10,
    scale: 2,
  })
  price: string | null;

  @Column("varchar", {
    name: "sku_name",
    nullable: true,
    comment: "规格名称",
    length: 500,
  })
  skuName: string | null;

  @Column("longtext", { name: "sku_desc", nullable: true, comment: "规格明细" })
  skuDesc: string | null;
}
